/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "recordlevelelement")
@NamedQueries({
    @NamedQuery(name = "Recordlevelelement.findAll", query = "SELECT r FROM Recordlevelelement r"),
    @NamedQuery(name = "Recordlevelelement.findByIdrecordlevelelement", query = "SELECT r FROM Recordlevelelement r WHERE r.idrecordlevelelement = :idrecordlevelelement"),
    @NamedQuery(name = "Recordlevelelement.findByModified", query = "SELECT r FROM Recordlevelelement r WHERE r.modified = :modified"),
    @NamedQuery(name = "Recordlevelelement.findByInformationwithheld", query = "SELECT r FROM Recordlevelelement r WHERE r.informationwithheld = :informationwithheld"),
    @NamedQuery(name = "Recordlevelelement.findByDatageneralization", query = "SELECT r FROM Recordlevelelement r WHERE r.datageneralization = :datageneralization"),
    @NamedQuery(name = "Recordlevelelement.findByGlobaluniqueidentifier", query = "SELECT r FROM Recordlevelelement r WHERE r.globaluniqueidentifier = :globaluniqueidentifier"),
    @NamedQuery(name = "Recordlevelelement.findByRights", query = "SELECT r FROM Recordlevelelement r WHERE r.rights = :rights"),
    @NamedQuery(name = "Recordlevelelement.findByRightsholder", query = "SELECT r FROM Recordlevelelement r WHERE r.rightsholder = :rightsholder"),
    @NamedQuery(name = "Recordlevelelement.findByAccessrights", query = "SELECT r FROM Recordlevelelement r WHERE r.accessrights = :accessrights"),
    @NamedQuery(name = "Recordlevelelement.findByBibliographiccitation", query = "SELECT r FROM Recordlevelelement r WHERE r.bibliographiccitation = :bibliographiccitation"),
    @NamedQuery(name = "Recordlevelelement.findByIsrestricted", query = "SELECT r FROM Recordlevelelement r WHERE r.isrestricted = :isrestricted")})
public class Recordlevelelement implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idrecordlevelelement")
    private Integer idrecordlevelelement;
    @Basic(optional = false)
    @Column(name = "modified")
    @Temporal(TemporalType.TIMESTAMP)
    private Date modified;
    @Column(name = "informationwithheld")
    private String informationwithheld;
    @Column(name = "datageneralization")
    private String datageneralization;
    @Basic(optional = false)
    @Column(name = "globaluniqueidentifier")
    private String globaluniqueidentifier;
    @Column(name = "rights")
    private String rights;
    @Column(name = "rightsholder")
    private String rightsholder;
    @Column(name = "accessrights")
    private String accessrights;
    @Column(name = "bibliographiccitation")
    private String bibliographiccitation;
    @Column(name = "isrestricted")
    private Boolean isrestricted;
    @ManyToMany(mappedBy = "recordlevelelementList", fetch = FetchType.LAZY)
    private List<Dynamicproperty> dynamicpropertyList;
    @OneToMany(mappedBy = "recordlevelelement", fetch = FetchType.LAZY)
    private List<Specimen> specimenList;
    @JoinColumn(name = "idtype", referencedColumnName = "idtype")
    @ManyToOne(fetch = FetchType.LAZY)
    private Type type;
    @JoinColumn(name = "idownerinstitution", referencedColumnName = "idownerinstitution")
    @ManyToOne(fetch = FetchType.LAZY)
    private Ownerinstitution ownerinstitution;
    @JoinColumn(name = "idlanguage", referencedColumnName = "idlanguage")
    @ManyToOne(fetch = FetchType.LAZY)
    private Language language;
    @JoinColumn(name = "idinstitutioncode", referencedColumnName = "idinstitutioncode")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Institutioncode institutioncode;
    @JoinColumn(name = "iddataset", referencedColumnName = "iddataset")
    @ManyToOne(fetch = FetchType.LAZY)
    private Dataset dataset;
    @JoinColumn(name = "idcollectioncode", referencedColumnName = "idcollectioncode")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Collectioncode collectioncode;
    @JoinColumn(name = "idbasisofrecord", referencedColumnName = "idbasisofrecord")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Basisofrecord basisofrecord;

    public Recordlevelelement() {
    }

    public Recordlevelelement(Integer idrecordlevelelement) {
        this.idrecordlevelelement = idrecordlevelelement;
    }

    public Recordlevelelement(Integer idrecordlevelelement, Date modified, String globaluniqueidentifier) {
        this.idrecordlevelelement = idrecordlevelelement;
        this.modified = modified;
        this.globaluniqueidentifier = globaluniqueidentifier;
    }

    public Integer getIdrecordlevelelement() {
        return idrecordlevelelement;
    }

    public void setIdrecordlevelelement(Integer idrecordlevelelement) {
        this.idrecordlevelelement = idrecordlevelelement;
    }

    public Date getModified() {
        return modified;
    }

    public void setModified(Date modified) {
        this.modified = modified;
    }

    public String getInformationwithheld() {
        return informationwithheld;
    }

    public void setInformationwithheld(String informationwithheld) {
        this.informationwithheld = informationwithheld;
    }

    public String getDatageneralization() {
        return datageneralization;
    }

    public void setDatageneralization(String datageneralization) {
        this.datageneralization = datageneralization;
    }

    public String getGlobaluniqueidentifier() {
        return globaluniqueidentifier;
    }

    public void setGlobaluniqueidentifier(String globaluniqueidentifier) {
        this.globaluniqueidentifier = globaluniqueidentifier;
    }

    public String getRights() {
        return rights;
    }

    public void setRights(String rights) {
        this.rights = rights;
    }

    public String getRightsholder() {
        return rightsholder;
    }

    public void setRightsholder(String rightsholder) {
        this.rightsholder = rightsholder;
    }

    public String getAccessrights() {
        return accessrights;
    }

    public void setAccessrights(String accessrights) {
        this.accessrights = accessrights;
    }

    public String getBibliographiccitation() {
        return bibliographiccitation;
    }

    public void setBibliographiccitation(String bibliographiccitation) {
        this.bibliographiccitation = bibliographiccitation;
    }

    public Boolean getIsrestricted() {
        return isrestricted;
    }

    public void setIsrestricted(Boolean isrestricted) {
        this.isrestricted = isrestricted;
    }

    public List<Dynamicproperty> getDynamicpropertyList() {
        return dynamicpropertyList;
    }

    public void setDynamicpropertyList(List<Dynamicproperty> dynamicpropertyList) {
        this.dynamicpropertyList = dynamicpropertyList;
    }

    public List<Specimen> getSpecimenList() {
        return specimenList;
    }

    public void setSpecimenList(List<Specimen> specimenList) {
        this.specimenList = specimenList;
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public Ownerinstitution getOwnerinstitution() {
        return ownerinstitution;
    }

    public void setOwnerinstitution(Ownerinstitution ownerinstitution) {
        this.ownerinstitution = ownerinstitution;
    }

    public Language getLanguage() {
        return language;
    }

    public void setLanguage(Language language) {
        this.language = language;
    }

    public Institutioncode getInstitutioncode() {
        return institutioncode;
    }

    public void setInstitutioncode(Institutioncode institutioncode) {
        this.institutioncode = institutioncode;
    }

    public Dataset getDataset() {
        return dataset;
    }

    public void setDataset(Dataset dataset) {
        this.dataset = dataset;
    }

    public Collectioncode getCollectioncode() {
        return collectioncode;
    }

    public void setCollectioncode(Collectioncode collectioncode) {
        this.collectioncode = collectioncode;
    }

    public Basisofrecord getBasisofrecord() {
        return basisofrecord;
    }

    public void setBasisofrecord(Basisofrecord basisofrecord) {
        this.basisofrecord = basisofrecord;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idrecordlevelelement != null ? idrecordlevelelement.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Recordlevelelement)) {
            return false;
        }
        Recordlevelelement other = (Recordlevelelement) object;
        if ((this.idrecordlevelelement == null && other.idrecordlevelelement != null) || (this.idrecordlevelelement != null && !this.idrecordlevelelement.equals(other.idrecordlevelelement))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Recordlevelelement[idrecordlevelelement=" + idrecordlevelelement + "]";
    }

}
